#ifndef COLLISION_H
#define COLLISION_H

#include <QObject>
#include "player.h"

class Player;

class Collision : public QObject
{
    Q_OBJECT
public:
    Collision();

    void checkCollision(Player *p);
    double pointToLineDistance(QLineF line, QPointF point);
    double distanceFromSegment(QLineF line, QPointF point, int &voronoiPoint, double & angle);
    int getPolygonCollisionCount(QGraphicsItem* p);
    double getClosestIntersectionPointOnPolygons(QLineF l, QList<QGraphicsPolygonItem*> polys, QPointF *intPoint);
    QList<QGraphicsPolygonItem*> getCollidingPolygons(QGraphicsItem* p);
    QList<Player*> getCollidingPlayers(QGraphicsItem* p);
};

#endif // COLLISION_H
